<!DOCTYPE html>
<!-- saved from url=(0032)http://www.qukiss.com/user/login -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户登录</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="layui/css/layui.css" media="all">
<link rel="stylesheet" href="layui/css/global.css" media="all">
<link rel="stylesheet" href="layui/css/desktop.css" media="all">
<link id="layuicss-skinlayercss" rel="stylesheet" href="layui/css/layer.css" media="all">
<link id="layuicss-laydatecss" rel="stylesheet" href="layui/css/laydate.css" media="all">
<script src="layui/layui.js" charset="utf-8"></script>
<script src="js/vue/vue.min.js"></script>
<script src="js/jquery/jquery.min.js" charset="utf-8"></script>
<script
	src="js/jquery.validation/jquery-validation-1.14.0/lib/jquery.js"></script>
<script
	src="js/jquery.validation/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
<script
	src="js/jquery.validation/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script>
<style>
input.error {
	border: 1px solid #E6594E;
}
</style>
<style>
.error{
	color:red;
}
</style>
</head>
<body>
	<div class="layui-header layui-bg-black header header-doc">
		<div class="layui-main">
			<ul class="layui-nav">

				<li class="layui-nav-item layui-this"><a href="/login.html">登陆</a></li>
				<li class="layui-nav-item "><a href="/regist.html">注册</a></li>
				<span class="layui-nav-bar"
					style="left: 72px; top: 56px; width: 0px; opacity: 0;"></span>

			</ul>
		</div>
	</div>
	<div class="layui-main" style="min-height: 640px;">
		<h2 class="page-title">登陆</h2>
		<form id="loginUser" action="" method="post" "layui-formlayui-form-pane">
			<div class="layui-form-item">
				<label class="layui-form-label" for="userName">用户名</label>
				<div class="layui-input-inline">
					<input class="layui-input" type="text" id="userName"
						name="userName" lay-verify="userName" value=""
						placeholder="请输入用户名" autocomplete="off">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label" for="pwdword">密码</label>
				<div class="layui-input-inline">
					<input class="layui-input" type="pwdword" id="pwdword"
						name="pwdword" lay-verify="pwdword" value="" placeholder="请输入密码"
						autocomplete="off">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">记住密码</label>
				<div class="layui-input-block">

					<div class="layui-unselect layui-form-switch">
						<i></i>
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button id="userLogin" class="layui-btn" type="submit">会员登陆</button>
					<a class="layui-btn layui-btn-primary" href="/index.jsp">忘记密码？</a>
				</div>
			</div>
		</form>
	</div>
	<script>
		var getUser = function() {
			if (!validform().form()) {
				return;
			}
			$.ajax({
				type : "post",
				dataType : "json",
				url : "/user/getuser",
				data : {
					"userName" : $("#userName").val(),
					"pwdword" : $("#pwdword").val()
				//向服务端传的参数，此处只是演示
				},
				success : function(msg) {

					location.href = "/" + msg.rsMsg;

				}
			});
		}
		$("#userLogin").on('click', function() {
			getUser();
		});

		//表单提交验证，校验表单
		var validform = function() {
			return $("#loginUser").validate({
				rules : {
					userName : {
						required : true
					},
					pwdword : {
						required : true
					}
				},
				messages : {
					userName : {
						required : ""
					},
					pwdword : {
						required : ""
					}
				}
			});

		}
		// 在键盘按下并释放及提交后验证提交表单，不是全部填写完成点提交才显示提示信息的
		$().ready(function() {

			validform();
		});
	</script>

</body>
</html>